#! /bin/bash

for data_file in ../data/*.in
do
	data_file_name=$(basename $data_file)_par
	file=jacquard/bench_$data_file_name.batch
	echo "#PBS -l nodes=1:ppn=2,walltime=00:10:00" > $file
	echo "#PBS -N like_$data_file_name" >> $file
	echo "#PBS -o ../results/jacquard/like_$data_file_name.out">> $file
	echo "#PBS -e ../results/jacquard/like_$data_file_name.err">> $file
	echo "#PBS -q batch">> $file
	echo "#PBS -S /bin/sh">> $file

	echo "">> $file
	echo "cd \$PBS_O_WORKDIR">> $file
	echo "../openmp-c/eg -i $data_file" >> $file
done

for data_file in ../data/*.in
do
	data_file_name=$(basename $data_file)_seq
	file=jacquard/bench_$data_file_name.batch
	echo "#PBS -l nodes=1:ppn=2,walltime=00:10:00" > $file
	echo "#PBS -N like_$data_file_name" >> $file
	echo "#PBS -o ../results/jacquard/like_$data_file_name.out">> $file
	echo "#PBS -e ../results/jacquard/like_$data_file_name.err">> $file
	echo "#PBS -q batch">> $file
	echo "#PBS -S /bin/sh">> $file

	echo "">> $file
	echo "cd \$PBS_O_WORKDIR">> $file
	echo "../openmp-cpp/eg -i $data_file" >> $file
done

